jsonwrt: Integration fixups
authorColin Walters <walters@verbum.org>
Thu, 26 Jun 2025 11:52:20 +0000 (07:52 -0400)
committerColin Walters <walters@verbum.org>
Thu, 26 Jun 2025 14:40:42 +0000 (10:40 -0400)
This gets the code to build without the rest of util-linux.

Signed-off-by: Colin Walters <walters@verbum.org>
src/libotutil/.clang-format-ignore [new file with mode: 0644]
src/libotutil/ul-jsonwrt.c
src/libotutil/ul-jsonwrt.h

diff --git a/src/libotutil/.clang-format-ignore b/src/libotutil/.clang-format-ignore
new file mode 100644 (file)
index 0000000..67b057c
--- /dev/null
@@ -0,0 +1,2 @@
+# Because this is imported code
+ul-jsonwrt*
index 365d845ce91582e212e38ccb76bb6d9ece9cca5b..44339835c999efdf0e5383bc460b1646180a3199 100644 (file)
@@ -9,10 +9,13 @@
 #include <stdio.h>
 #include <inttypes.h>
 #include <ctype.h>
-#include <cctype.h>
 
-#include "c.h"
-#include "jsonwrt.h"
+// The following includes were modified from upstream
+#include "ul-jsonwrt.h"
+#include <glib.h>
+#define c_toupper g_ascii_toupper
+#define c_tolower g_ascii_tolower
+#define assert g_assert
 
 /*
  * Requirements enumerated via testing (V8, Firefox, IE11):
index f156fdd423dcb0345c38d0d68603735aaf3fb30d..bddbe5edb7d53bafdd93f6bf4bdb9d619ae339bb 100644 (file)
@@ -5,6 +5,9 @@
 #ifndef UTIL_LINUX_JSONWRT_H
 #define UTIL_LINUX_JSONWRT_H
 
+#include <stdio.h>
+#include <stdint.h>
+
 enum {
        UL_JSON_OBJECT,
        UL_JSON_ARRAY,